import { ref } from 'vue'
import { defineStore } from 'pinia'

export const userInfoStore = defineStore('user', () => {
    //定义需要管理的数据
    const userinfo = ref({});

    //保存用户信息
    function save_userinfo(payload: any) {
        userinfo.value = payload;
    }

    //删除用户信息
    function delete_userinfo() {
        userinfo.value = {};
    }

    return {
        userinfo, save_userinfo, delete_userinfo
    };
}, { persist: true })